<center><h1>¡Introdusca la clave!</h1></center>
<div>
    <br>
    <div class="form">
        <form action="cliente/create_member" method="post" class="niceform" id="login_form">

            <fieldset>
                <?php
                echo form_open('login/validate_credentials');
                //echo form_open('login/admin');
                echo form_input('username', 'Username');
                echo form_password('password', 'Password');
                // echo form_submit('submit', 'Aceptar');
                // echo form_reset('sumit', 'Cancelar');
                echo form_close();
                ?>
                <dl class="submit">
                    <button type="button" onclick="buscar(); return false;">Enviar</button>
                    <input type="reset" value="Cancelar"/>
                </dl>
            </fieldset>

        </form>
    </div>

</div>

<script>

    function buscar() {
        var dataString = $('#login_form').serialize();
        // alert(dataString);
        $.ajax({
            //url:// "http://localhost/disenoweb1/index.php/password/validate_credentials",
            url: "login/validate_credentials",
            type: "post",
            data: dataString,
            success: function (data) {
                window.location.replace(data);
                //var admin = $.parseJSON(data);

                //$("#txt_nombre").val(empleado[0].nombre);
                // $("#txt_apellido1").val(empleado[0].apellido1);
                //$("#txt_apellido2").val(empleado[0].apellido2);
                //$("#txt_direccion").val(empleado[0].direccion);
                //$("#txt_telefono").val(empleado[0].telefono);
                //$("#txt_email").val(empleado[0].email);
            },
            error: function () {
                alert("failure");
                //$("#result").html('there is error while submit');
            }
        });
    }
</script>